function UserManager(layoutManager) {

	var self = this;
	this.user = null;

	this.gotoSigninPage = function() {
		window.location.replace('login.html');
	};

	this.gotoErrorPage = function() {
		window.location.replace('error.html');
	};

	this.loadUser = function(user) {
		var bookManager = new BookManager();
		this.user = new User(user.id, user.login, user.name);
		this.populateUserInfo();
		this.user.addBooksSubscriber(function() {
			var book = null;
			if(self.user.books().length > 0) {
				book = self.user.books()[0];
			}
			bookManager.setBook(book);
		});
		this.user.updateBooks();
	};

	this.populateUserInfo = function() {
		var userMenuDiv = '#userMenu';
		$('#userInfo').html('<div id="userMenu"></div>');
		$('#userInfo').jqxDropDownButton({ width: 100, height: 20,
			dropDownHorizontalAlignment: 'right', autoOpen: true });
		$('#userInfo').jqxDropDownButton('setContent', this.user.name);
		var html = '<table class="table-layout"><tr><td><div id="userProfileBtn">Профиль</div></td><td><div id="signoutBtn">Выход</div></td></tr></table>';
		$(userMenuDiv).html(html);
		$("#userProfileBtn").jqxButton().on('click', function() { alert(123); });
		$("#signoutBtn").jqxButton().on('click', function() { self.signout() });
	};
};